import InfoService from '../service/info-service';
import * as Koa from 'koa';

class InfoController {
  private service: InfoService = new InfoService();

  // 添加
  addInfo = async (ctx: Koa.Context) => {
    await this.service.addInfo(ctx);
  };

  // 删除
  delInfo = async (ctx: Koa.Context) => {
    await this.service.delInfo(ctx);
  };

  // 修改
  updateInfo = async (ctx: Koa.Context) => {
    await this.service.updateInfo(ctx);
  };

  // 查询
  searchInfo = async (ctx: Koa.Context) => {
    await this.service.searchInfo(ctx);
  };
}

export default new InfoController();
